package com.example.certificate.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.certificate.dto.CustomerDTO;
import com.example.certificate.dto.UpdateCusDTO;
import com.example.certificate.entity.CustomerAddr;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.certificate.entity.User;
import com.example.certificate.execption.BusinessException;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author hao
 * @since 2022-03-10 09:54:48
 */
public interface CustomerAddrService extends IService<CustomerAddr> {
    /**
     * 给用户添加收货地址
     * @param dto
     * @param user
     */
    void addCustomer(CustomerDTO dto, User user);

    /**
     * 查询用户收货地址
     * @param page
     * @return
     */
    Page<CustomerAddr> selCustomer(Page<CustomerAddr> page, User user);


    /**
     * 修改用户收货地址
     * @param dto
     * @param user
     */
    void updateCus(UpdateCusDTO dto, User user) throws BusinessException;

    /**
     * 删除用户收货地址
     * @param dto
     * @param user
     * @throws BusinessException
     */
    void delCus(UpdateCusDTO dto,User user);

    /**
     * 查询用户使用的地址
     * @param user
     * @return
     */
    CustomerAddr selUserAddress(User user);
}
